// 用来管理所有的请求接口
import service from "./request";
// 登录接口和数据
export const Login = (data)=>{
  return service({
    method:'post',
    url:'/login',
    data
  })
}
// 获取侧边栏
export const GetMenus = ()=>{
  return service({
    method:'get',
    url:'/menus',
  })
}
// 获取用户列表
export const GetUsers = (params)=>{
  return service({
    method:'get',
    url:'/users',
    params
  })
}
// 添加用户
export const AddUsers = (data)=>{
  return service({
    method:'post',
    url:'/users',
    data
  })
}
// 获取单条用户信息
export const GetOneUsers = (params)=>{
  return service({
    method:'get',
    url:'/users/'+params,
  })
}
// 修改用户
export const EditUsers = (data)=>{
  return service({
    method:'put',
    url:'/users/'+data.id,
    data
  })
}
// 删除用户
export const DelUsers = (params)=>{
  return service({
    method:'delete',
    url:'/users/'+params,
  })
}

// 获取用户列表
export const GetCategories = (params)=>{
  return service({
    method:'get',
    url:'/categories',
    params
  })
}
// 添加分类
export const AddCategories = (data)=>{
  return service({
    method:'post',
    url:'/categories',
    data
  })
}
// 根据id查询分类
// export const GetOneCategories = (params)=>{
//   return service({
//     method:'get',
//     url:'/users/'+params,
//   })
// }